/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package view.jPanels;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 *
 * @author Gean
 */
@Entity
@Table(name = "responsavel", catalog = "", schema = "")
@NamedQueries({
    @NamedQuery(name = "Responsavel.findAll", query = "SELECT r FROM Responsavel r"),
    @NamedQuery(name = "Responsavel.findBySiape", query = "SELECT r FROM Responsavel r WHERE r.siape = :siape"),
    @NamedQuery(name = "Responsavel.findBySenhaSIAPE", query = "SELECT r FROM Responsavel r WHERE r.senhaSIAPE = :senhaSIAPE"),
    @NamedQuery(name = "Responsavel.findByNomeResp", query = "SELECT r FROM Responsavel r WHERE r.nomeResp = :nomeResp"),
    @NamedQuery(name = "Responsavel.findByEmail", query = "SELECT r FROM Responsavel r WHERE r.email = :email"),
    @NamedQuery(name = "Responsavel.findByCargo", query = "SELECT r FROM Responsavel r WHERE r.cargo = :cargo"),
    @NamedQuery(name = "Responsavel.findByIdPredio", query = "SELECT r FROM Responsavel r WHERE r.idPredio = :idPredio"),
    @NamedQuery(name = "Responsavel.findByIdSala", query = "SELECT r FROM Responsavel r WHERE r.idSala = :idSala")})
public class Responsavel implements Serializable {
    @Transient
    private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "SIAPE")
    private Integer siape;
    @Basic(optional = false)
    @Column(name = "SenhaSIAPE")
    private String senhaSIAPE;
    @Basic(optional = false)
    @Column(name = "NomeResp")
    private String nomeResp;
    @Basic(optional = false)
    @Column(name = "Email")
    private String email;
    @Basic(optional = false)
    @Column(name = "Cargo")
    private String cargo;
    @Basic(optional = false)
    @Column(name = "idPredio")
    private int idPredio;
    @Basic(optional = false)
    @Column(name = "idSala")
    private int idSala;

    public Responsavel() {
    }

    public Responsavel(Integer siape) {
        this.siape = siape;
    }

    public Responsavel(Integer siape, String senhaSIAPE, String nomeResp, String email, String cargo, int idPredio, int idSala) {
        this.siape = siape;
        this.senhaSIAPE = senhaSIAPE;
        this.nomeResp = nomeResp;
        this.email = email;
        this.cargo = cargo;
        this.idPredio = idPredio;
        this.idSala = idSala;
    }

    public Integer getSiape() {
        return siape;
    }

    public void setSiape(Integer siape) {
        Integer oldSiape = this.siape;
        this.siape = siape;
        changeSupport.firePropertyChange("siape", oldSiape, siape);
    }

    public String getSenhaSIAPE() {
        return senhaSIAPE;
    }

    public void setSenhaSIAPE(String senhaSIAPE) {
        String oldSenhaSIAPE = this.senhaSIAPE;
        this.senhaSIAPE = senhaSIAPE;
        changeSupport.firePropertyChange("senhaSIAPE", oldSenhaSIAPE, senhaSIAPE);
    }

    public String getNomeResp() {
        return nomeResp;
    }

    public void setNomeResp(String nomeResp) {
        String oldNomeResp = this.nomeResp;
        this.nomeResp = nomeResp;
        changeSupport.firePropertyChange("nomeResp", oldNomeResp, nomeResp);
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        String oldEmail = this.email;
        this.email = email;
        changeSupport.firePropertyChange("email", oldEmail, email);
    }

    public String getCargo() {
        return cargo;
    }

    public void setCargo(String cargo) {
        String oldCargo = this.cargo;
        this.cargo = cargo;
        changeSupport.firePropertyChange("cargo", oldCargo, cargo);
    }

    public int getIdPredio() {
        return idPredio;
    }

    public void setIdPredio(int idPredio) {
        int oldIdPredio = this.idPredio;
        this.idPredio = idPredio;
        changeSupport.firePropertyChange("idPredio", oldIdPredio, idPredio);
    }

    public int getIdSala() {
        return idSala;
    }

    public void setIdSala(int idSala) {
        int oldIdSala = this.idSala;
        this.idSala = idSala;
        changeSupport.firePropertyChange("idSala", oldIdSala, idSala);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (siape != null ? siape.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Responsavel)) {
            return false;
        }
        Responsavel other = (Responsavel) object;
        if ((this.siape == null && other.siape != null) || (this.siape != null && !this.siape.equals(other.siape))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "view.jPanels.Responsavel[ siape=" + siape + " ]";
    }

    public void addPropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.removePropertyChangeListener(listener);
    }
    
}
